function x = chebpoints(N, xmin, xmax)

  %x = (xmin - xmax)./2.*(cos(pi*(2*(0:N-1)+1)./(2*N))-1) + xmin;
  x = (xmin - xmax)./2.*(cos(pi*(2*(0:N-1))./(2*(N-1)))-1) + xmin;

end
